#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <qlistview.h>
#include <QListView>
#include <QStringListModel>
#include <QFont>
#include <winsock2.h>
#include "tcpserver.h"
#include "tcpclient.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

public slots:
    void openNewClientWindow();
    void serverReceiveMessage(QString message);
    void showClientNum(qint8 nums);
    void showServerState(bool m_state);

private:
    Ui::MainWindow *ui;
    TCPServer* m_tcpServer;         //服务器
    QStringList chat_content;       //聊天框
    QStringListModel *chat_model;
};
#endif // MAINWINDOW_H
